import {createRouter, createWebHistory} from 'vue-router'
import LayoutView from "@/views/common/layout.vue"
import Login from "@/views/login/index.vue";
import Home from "@/views/home/index.vue"
import Game from "@/views/game/index.vue"
import Music from "@/views/music/index.vue"
import Movie from "@/views/movie/index.vue"
import Reading from "@/views/reading/index.vue"
import Chat from "@/views/chat/index.vue"
import {ConfigTitle} from "@/config/data";

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [{
        path: '/login',
        name: 'login',
        component: Login
    },
        {
            path: '/',
            name: 'home',
            component: LayoutView,
            redirect: ConfigTitle.HOME,
            children: [
                {
                    path: '/' + ConfigTitle.GAME,
                    name: ConfigTitle.GAME,
                    component: Game
                },
                {
                    path: '/' + ConfigTitle.HOME,
                    name: ConfigTitle.HOME,
                    component: Home
                },
                {
                    path: '/' + ConfigTitle.MUSIC,
                    name: ConfigTitle.MUSIC,
                    component: Music
                },
                {
                    path: '/' + ConfigTitle.MOVIE,
                    name: ConfigTitle.MOVIE,
                    component: Movie
                },
                {
                    path: '/' + ConfigTitle.READING,
                    name: ConfigTitle.READING,
                    component: Reading
                },
                {
                    path: '/' + ConfigTitle.CHAT,
                    name: ConfigTitle.CHAT,
                    component: Chat
                }
            ]
        },

    ]
})

export default router
